#!/bin/sh

THISPATH=`realpath "$0"`
cd "`dirname "$THISPATH"`"
BASEDIR=`pwd`
cd - >/dev/null


if [ $# -eq 2 ] ;then
    jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/apkkey.jks -storepass Ceshi123456 -signedjar $2 $1 apkkey
else
	if [ $3 = "jlmmxkey" ] ;then
	    echo 'sign with jlmmx'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/jlmmxkey.keystore -storepass 123123 -signedjar $2 $1 mykey
	elif [ $3 = "user" ] ;then
	    echo 'sign with killthevirus'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/gu.keystore -storepass 123456 -signedjar $2 $1 killthevirus
	elif [ $3 = "user2" ] ;then
	    echo 'sign with 熊孩子快跑'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/user2.keystore -storepass 123456 -signedjar $2 $1 熊孩子快跑
	elif [ $3 = "laogu" ] ;then
	    echo 'sign with laogu'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/laogu.keystore -storepass laogu123 -signedjar $2 $1 laogu
	elif [ $3 = "newkey" ] ;then
	    echo 'sign with newkey'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/newkey.keystore -storepass 123456 -signedjar $2 $1 newkey
	elif [ $3 = "eryingzhang" ] ;then
	    echo 'sign with eryingzhang'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/eryingzhang.keystore -storepass 123456 -signedjar $2 $1 eryingzhang
	elif [ $3 = "stumpme" ] ;then
	    echo 'sign with stumpme'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/stumpme.keystore -storepass 123456 -signedjar $2 $1 stumpme
	elif [ $3 = "westcowboy" ] ;then
	    echo 'sign with '$3
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/westcowboy.keystore -storepass 123456 -signedjar $2 $1 westcowboy
	else
	    echo 'sign with ttxxl'
		jarsigner  -sigalg SHA1withRSA -digestalg SHA1 -keystore $BASEDIR/keys/ttxxl.keystore -storepass 123123 -signedjar $2 $1 mykey
	fi
fi

